home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / twins.com / SCREENS.INF < prev    next >
Encoding:
Text File  |  1990-02-15  |  4.8 KB  |  165 lines

  1.                       (***********************************)
  2.                       (*       TWINS Version 1.01        *)
  3.                       (***********************************)
  4.                       (*     Object - Oriented Windows   *)
  5.                       (*  for Turbo Pascal Version 5.5   *)
  6.                       (*         Copyright 1990          *)
  7.                       (*          Brian Corll            *)
  8.                       (*       ALL RIGHTS RESERVED       *)
  9.                       (***********************************)
  10.                       (***********************************)
  11.                       (*   Turbo Pascal is a registered  *)
  12.                       (* trademark of Borland Int. Corp. *)
  13.                       (***********************************)
  14.                       (*   Portions Copyright 1984,1989  *)
  15.                       (*    Borland International Corp.  *)
  16.                       (***********************************)
  17.                       (***********************************)
  18.  
  19.  
  20. UNIT Screens;
  21.  
  22.  
  23. {$L Flash}
  24. {$L Attr}
  25. {$L Screen}
  26.  
  27.  
  28. INTERFACE
  29.  
  30. Uses DOS;
  31.  
  32. TYPE
  33.  Borders = String[6];
  34.  VertStr = String[25];
  35.  Direction = (Up,Down);
  36.  
  37. CONST
  38.  
  39.  SolidBrdr   : Borders = '██████';
  40.  SingleBrdr  : Borders = '┌└┐┘─│';
  41.  DoubleBrdr  : Borders = '╔╚╗╝═║';
  42.  Stars       : Borders = '******';
  43.  QuarterTone : Borders = '░░░░░░';
  44.  HalfTone    : Borders = '▒▒▒▒▒▒';
  45.  Chr254      : Borders = '■■■■■■';
  46.  
  47.  {Color constants - defined to take advantage of Turbo Pascal's
  48.  constant folding capabilities.  See documentation.}
  49.  
  50.  
  51.   Black        = $00;       DarkGray     = $08;
  52.   Blue         = $01;       LightBlue    = $09;
  53.   Green        = $02;       LightGreen   = $0A;
  54.   Cyan         = $03;       LightCyan    = $0B;
  55.   Red          = $04;       LightRed     = $0C;
  56.   Magenta      = $05;       LightMagenta = $0D;
  57.   Brown        = $06;       Yellow       = $0E;
  58.   LightGray    = $07;       White        = $0F;
  59.   Blink        = $80;
  60.  
  61.   BlackBG      = $00;
  62.   BlueBG       = $10;
  63.   GreenBG      = $20;
  64.   CyanBG       = $30;
  65.   RedBG        = $40;
  66.   MagentaBG    = $50;
  67.   BrownBG      = $60;
  68.   LightGrayBG  = $70;
  69.  
  70.  
  71.  
  72. TYPE
  73.  ScreenType = Array[0..3999] of Byte;
  74.  ScrPtr = ^ScreenType;
  75.  DisplayType = (Monochrome, CGA, EGA, MCGA, VGA);
  76.  
  77. VAR
  78.  VideoBase : WORD;
  79.  VideoWait : BOOLEAN;
  80.  SnowCheck : BOOLEAN;
  81.  VideoOffset : BYTE;
  82.  VideoMode : BYTE;
  83.  VideoWidth : BYTE;
  84.  VideoPage  : BYTE;
  85.  Mono : BOOLEAN;
  86.  Regs : Registers;
  87.  VidMode : BYTE;
  88.  
  89.  
  90.  
  91. FUNCTION  SaveScreen : ScrPtr;
  92. (* Saves the entire screen in VAR of type ScrPtr *)
  93.  
  94. PROCEDURE RestoreScreen(VAR SavedScreen : ScrPtr);
  95. (* Restores screen previously saved in VAR of type ScrPtr *)
  96.  
  97. PROCEDURE RestScr(SRow,SCol,ERow,ECol : BYTE;VAR Buffer : POINTER);
  98. (* Restores an area of a screen previously saved in a buffer *)
  99.  
  100. PROCEDURE SaveScr(SRow,SCol,ERow,ECol : BYTE;VAR Buffer : POINTER);
  101. (* Saves an area of a screen in a buffer *)
  102.  
  103. PROCEDURE Flash(Row,Col, Attr:byte; Str : String);
  104. (* Writes a string directly to video memory *)
  105.  
  106. PROCEDURE CursorOn;
  107.  
  108. PROCEDURE CursorOff;
  109.  
  110. PROCEDURE BlockCursor;
  111.  
  112. PROCEDURE DrawBox(Row1,Col1,Row2,Col2 : Byte;Color : Byte;BorderType : Borders);
  113.  
  114. PROCEDURE ChAttr(Number : Word; Row, Col, Attr : Word);
  115. (* Changes a specified number of video attributes at a specified row and column *)
  116.  
  117. PROCEDURE ChAllAttr(Row,Col,Rows,Cols,Attr : Word);
  118.  
  119. PROCEDURE FlashC(Row,Attr:Byte;Str : String);
  120.  
  121. PROCEDURE ScreenToBuffer(VAR Source,Dest;Length:WORD);
  122. (* Moves a screen region to a memory buffer *)
  123.  
  124. PROCEDURE BufferToScreen(VAR Source,Dest; Length:WORD);
  125. (* Restores a screen region from a memory buffer *)
  126.  
  127. PROCEDURE Vertical(Row,Col,Color : BYTE;Str : VertStr);
  128. (* Writes a string vertically *)
  129.  
  130. PROCEDURE Diagonal(Row,Col,Color,Increment : BYTE;Str : String);
  131. (* Writes a string diagonally *)
  132.  
  133. PROCEDURE HBar(Row,Col,Len,Color : BYTE;BarChar : CHAR);
  134. (* Creates a horizontal textmode bar *)
  135.  
  136. PROCEDURE VBar(Row,Col,Len,Color : BYTE;BarStr : String);
  137. (* Creates a vertical textmode bar *)
  138.  
  139. PROCEDURE Scroll(NumLines,SRow,SCol,ERow,ECol,Color : BYTE;
  140.    WhichWay : Direction);
  141. (* Scrolls a screen region.  NumLines = 0 clears the screen region. *)
  142.  
  143. PROCEDURE GetVideoStatus;
  144. (* Gets current video status and returns it in global VARS VideoMode,
  145.    VideoWodth,VideoPage *)
  146.  
  147. PROCEDURE SetVideoMode(Mode : BYTE);
  148. (* Select a video mode from 0..3 *)
  149.  
  150. PROCEDURE SetVisiblePage(Page : BYTE);
  151. (* Set visible video page 0..3 *)
  152.  
  153. PROCEDURE SetVirtualPage(Page : BYTE);
  154. (* Set virtual video page 0..3 *)
  155.  
  156. PROCEDURE ClearVirtualPage(Color : BYTE);
  157. (* Clear a virtual page using a specified color attribute *)
  158.  
  159. FUNCTION  PrintScreen : BOOLEAN;
  160. (* Print a screen and return success/failure *)
  161.  
  162. PROCEDURE ClearScreen(SRow,SCol,ERow,ECol,Color : BYTE);
  163. (* Clear a screen region using a specified color attribute *)
  164.  
  165.